﻿using System;
using System.Collections.Generic;
using System.Text;

namespace _20_Strategy
{
    public class Factory
    {
        private Dictionary<string, Strategy> dics;
        public Dictionary<string, Strategy> AddStrategy(string key)
        {
            if (dics.Count==0)
            {
                dics.Add("a", new StrategyImp01());
                dics.Add("b", new StrategyImp02());
                dics.Add("c", new StrategyImp03());
                dics.Add("d", new StrategyImp04());
            }
            return dics;
        }
        public Strategy GetStrategy(string key)
        {
            return dics[key];
        }
    }
}
